<%@page import="com.entities.projectversion.actionscript.ActionScriptParserProjectVersionAdd"%>
<%@page import="com.entities.projectversion.list.ProjectVersionListController"%>
<%@page import="com.core.utils.GlobalConstants"%>
<%@page import="com.entities.projecttask.actionscript.ActionScriptParserProjectTaskAdd"%>
<%@page import="com.core.ui.controller.ActionBarController"%>
<%@page import="com.core.managers.SessionManager"%>
<%@taglib prefix="sorokina" uri="/WEB-INF/Sorokina.tld"%>
<script type="text/javascript">
    function deleteVersion(versionId){
        var confirmResult = confirm("Are you sure?");
        if (confirmResult){

            jQuery.post('<%=GlobalConstants.SERVLET_VERSIONDELETE%>',
                    {'id'        : versionId}
                    ,function(data){
                        location.reload();
                    }
            );
            
        }
    }
</script>

<%
	SessionManager.setContext(GlobalConstants.USERCONTEXT_VERSIONSLIST);
    String projectId = request.getParameter("id");

    ProjectVersionListController projectVersionsListController = new ProjectVersionListController();
    projectVersionsListController.setProjectId(projectId);

    ActionScriptParserProjectVersionAdd actionScriptParserProjectVersionAdd = new ActionScriptParserProjectVersionAdd();
    actionScriptParserProjectVersionAdd.setProjectId(projectId);

    ActionBarController actionBarController = new ActionBarController();
    actionBarController.setActionScriptParser(actionScriptParserProjectVersionAdd);
%>

<div>

    <sorokina:ActionBarView datasource="<%=actionBarController %>" />
    <sorokina:TableView datasource="<%=projectVersionsListController%>" delegate="<%=projectVersionsListController%>" />
</div>